#include <iostream>
#include <memory>
#include "recipefactory.h"

using namespace std;

int main (void)
{
	
	RecipeFactory rf;
	
	auto r = rf.get_recipe("RUMCOKE", "../RecipeList.xml");
	
	if(r.get() != NULL)
	{
		cout << endl;
		cout << r->get_name() << endl;
		cout << "  Key: "<< r->get_key() << endl;
		cout << "  Volume: "<< r->get_volume() << endl;
		cout << "  Ingredients: " << endl;
		
		auto ingredients = r->get_ingredients();
		for ( auto i = ingredients.begin(); i != ingredients.end(); ++i)
		{
			cout << "    " << i->get_name() << endl;
			cout << "      Key: " << i->get_key() << endl;
			cout << "      Amount: " << i->get_amount() << endl;
		}
		cout << endl;
	}
	
	cout << "end program" << endl;
	return 0;
}
